<?php
namespace PsiFramework\Applications\DefaultApp\Classes\Model;

use \PsiFramework\Classes\Model\Object;
use \PsiFramework\Applications\DefaultApp\Classes\Model\User;
use \PsiFramework\Classes\Util\Object\Date;

/**
 * PsiFramework
 * Php Simple Framework
 *
 * @author Rémi San
 * @version beta
 */

/**
 * The Message class is a Model Business Class
 *
 * @package Model
 */

class Message extends Object
{

    protected /*int*/     $_id;
    protected /*string*/  $_conversationId;
    protected /*User*/    $_sender;
    protected /*User*/    $_recipient;
    protected /*string*/  $_senderEmail;
    protected /*string*/  $_recipientEmail;
    protected /*string*/  $_senderName;
    protected /*string*/  $_recipientName;
    protected /*string*/  $_senderIp;
    protected /*string*/  $_title;
    protected /*text*/    $_content;
    protected /*Date*/    $_date;
    protected /*boolean*/ $_read;


    /**
     * Message Constructor
     *
     *@param int     $id             the id
     *@param string  $conversationId the conversationId
     *@param User    $sender         the sender
     *@param User    $recipient      the recipient
     *@param string  $senderEmail    the senderEmail
     *@param string  $recipientEmail the recipientEmail
     *@param string  $senderName     the senderName
     *@param string  $recipientName  the recipientName
     *@param string  $senderIp       the senderIp
     *@param string  $title          the title
     *@param text    $content        the content
     *@param Date    $date           the date
     *@param boolean $read           the read
     *
     *@return Message
     */
    public function __construct(
            /*int*/     $id=null,
            /*string*/  $conversationId=null,
            /*User*/    $sender=null,
            /*User*/    $recipient=null,
            /*string*/  $senderEmail=null,
            /*string*/  $recipientEmail=null,
            /*string*/  $senderName=null,
            /*string*/  $recipientName=null,
            /*string*/  $senderIp=null,
            /*string*/  $title=null,
            /*text*/    $content=null,
            /*Date*/    $date=null,
            /*boolean*/ $read=null
    )
    {
        $this->_id             = $id;
        $this->_conversationId = $conversationId;
        $this->_sender         = $sender;
        $this->_recipient      = $recipient;
        $this->_senderEmail    = $senderEmail;
        $this->_recipientEmail = $recipientEmail;
        $this->_senderName     = $senderName;
        $this->_recipientName  = $recipientName;
        $this->_senderIp       = $senderIp;
        $this->_title          = $title;
        $this->_content        = $content;
        $this->_date           = $date;
        $this->_read           = $read;
    }


    /**
     * Setter for the member variable $id
     *
     * @param int $id the id
     *
     * @return void
     */
    public function setId(/*int*/ $id)
    {
        $this->_id = $id;
    }

    /**
     * Getter for the member variable $id
     *
     * @return int
     */
    public function getId()
    {
        return $this->_id;
    }


    /**
     * Setter for the member variable $conversationId
     *
     * @param string $conversationId the conversationId
     *
     * @return void
     */
    public function setConversationId(/*string*/ $conversationId)
    {
        $this->_conversationId = $conversationId;
    }

    /**
     * Getter for the member variable $conversationId
     *
     * @return string
     */
    public function getConversationId()
    {
        return $this->_conversationId;
    }


    /**
     * Setter for the member variable $sender
     *
     * @param User $sender the sender
     *
     * @return void
     */
    public function setSender(/*User*/ $sender)
    {
        $this->_sender = $sender;
    }

    /**
     * Getter for the member variable $sender
     *
     * @return User
     */
    public function getSender()
    {
        return $this->_sender;
    }


    /**
     * Setter for the member variable $recipient
     *
     * @param User $recipient the recipient
     *
     * @return void
     */
    public function setRecipient(/*User*/ $recipient)
    {
        $this->_recipient = $recipient;
    }

    /**
     * Getter for the member variable $recipient
     *
     * @return User
     */
    public function getRecipient()
    {
        return $this->_recipient;
    }


    /**
     * Setter for the member variable $senderEmail
     *
     * @param string $senderEmail the senderEmail
     *
     * @return void
     */
    public function setSenderEmail(/*string*/ $senderEmail)
    {
        $this->_senderEmail = $senderEmail;
    }

    /**
     * Getter for the member variable $senderEmail
     *
     * @return string
     */
    public function getSenderEmail()
    {
        return $this->_senderEmail;
    }


    /**
     * Setter for the member variable $recipientEmail
     *
     * @param string $recipientEmail the recipientEmail
     *
     * @return void
     */
    public function setRecipientEmail(/*string*/ $recipientEmail)
    {
        $this->_recipientEmail = $recipientEmail;
    }

    /**
     * Getter for the member variable $recipientEmail
     *
     * @return string
     */
    public function getRecipientEmail()
    {
        return $this->_recipientEmail;
    }


    /**
     * Setter for the member variable $senderName
     *
     * @param string $senderName the senderName
     *
     * @return void
     */
    public function setSenderName(/*string*/ $senderName)
    {
        $this->_senderName = $senderName;
    }

    /**
     * Getter for the member variable $senderName
     *
     * @return string
     */
    public function getSenderName()
    {
        return $this->_senderName;
    }


    /**
     * Setter for the member variable $recipientName
     *
     * @param string $recipientName the recipientName
     *
     * @return void
     */
    public function setRecipientName(/*string*/ $recipientName)
    {
        $this->_recipientName = $recipientName;
    }

    /**
     * Getter for the member variable $recipientName
     *
     * @return string
     */
    public function getRecipientName()
    {
        return $this->_recipientName;
    }


    /**
     * Setter for the member variable $senderIp
     *
     * @param string $senderIp the senderIp
     *
     * @return void
     */
    public function setSenderIp(/*string*/ $senderIp)
    {
        $this->_senderIp = $senderIp;
    }

    /**
     * Getter for the member variable $senderIp
     *
     * @return string
     */
    public function getSenderIp()
    {
        return $this->_senderIp;
    }


    /**
     * Setter for the member variable $title
     *
     * @param string $title the title
     *
     * @return void
     */
    public function setTitle(/*string*/ $title)
    {
        $this->_title = $title;
    }

    /**
     * Getter for the member variable $title
     *
     * @return string
     */
    public function getTitle()
    {
        return $this->_title;
    }


    /**
     * Setter for the member variable $content
     *
     * @param text $content the content
     *
     * @return void
     */
    public function setContent(/*text*/ $content)
    {
        $this->_content = $content;
    }

    /**
     * Getter for the member variable $content
     *
     * @return text
     */
    public function getContent()
    {
        return $this->_content;
    }


    /**
     * Setter for the member variable $date
     *
     * @param Date $date the date
     *
     * @return void
     */
    public function setDate(/*Date*/ $date)
    {
        $this->_date = $date;
    }

    /**
     * Getter for the member variable $date
     *
     * @return Date
     */
    public function getDate()
    {
        return $this->_date;
    }


    /**
     * Setter for the member variable $read
     *
     * @param boolean $read the read
     *
     * @return void
     */
    public function setRead(/*boolean*/ $read)
    {
        $this->_read = $read;
    }

    /**
     * Getter for the member variable $read
     *
     * @return boolean
     */
    public function isRead()
    {
        return $this->_read;
    }


    /**
     *The function that returns the object as a string
     *
     *@return string
     */
    public function toString()
    {
        return $this->_id;
    }

}